package day13;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class test2 {
    public static void main(String[] args) throws IOException {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入用户名");
        String userName=sc.next();
        System.out.println("请输入密码");
        String passWord=sc.next();
        FileWriter fw=new FileWriter("study\\src\\java1.txt");
        fw.write(userName);
        fw.write("\r\n");//回车换行符
        fw.write(passWord);
        fw.flush();
       fw.close();
    }
}
